package com.modudf.domain;

public class ResultInfo {

	public static final String SUCCESS_MESSAGE = "sucess";
	public static final int SUCCESS_CODE = 0;
	
	private int code;
	private String message;
	private Object data;

	public ResultInfo() {
		this(SUCCESS_CODE, SUCCESS_MESSAGE);
	}

	public ResultInfo(int code, String message) {
		this.code = code;
		this.message = message;
	}

	public ResultInfo(int code, String message, Object data) {
		super();
		this.code = code;
		this.message = message;
		this.data = data;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	
	public boolean isSuccess() {
		return code == SUCCESS_CODE;
	}
	
}
